﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NFactorySample
{
    #region interfaces
    interface ICompany
    {
        string CompanyName { get; }
    }

    interface IPerson
    {
        int Age { get; }
        string FirstName { get; }
        string LastName { get; }
    } 
    #endregion

    #region 'real' classes
    public class RealCompany : ICompany
    {
        public string CompanyName
        {
            get;
            set;
        }

        public RealCompany(string companyName)
        {
            CompanyName = companyName;
        }

        public RealCompany()
        {
            CompanyName = "Default real company";
        }
    }

    public class RealPerson : IPerson
    {
        public RealPerson()
        {
            FirstName = "Real";
            LastName = "Person";
            Age = 40;
        }

        public string FirstName
        {
            get;
            set;
        }

        public string LastName
        {
            get;
            set;
        }

        public int Age
        {
            get;
            set;
        }
    } 
    #endregion

    #region 'test' classes
    public class TestCompany : ICompany
    {
        public string CompanyName
        {
            get { return "Test company"; }
        }
    }

    public class TestPerson : IPerson
    {
        public TestPerson()
        {
        }

        public string FirstName
        {
            get { return "Test"; }
        }

        public string LastName
        {
            get { return "Person"; }
        }

        public int Age
        {
            get { return 30; }
        }
    } 
    #endregion

}

